"""
@author: chy
@file: 输出字典中value的最大值和平均值.py
@time: 2023/12/9 13:49
"""
dict1 = {"1":100,"2":90,"3":200,"4":200,"5":50,"6":150,"7":120,"8":30,"9":180,}

def maxvalue(dct):
    print(f"该字典中value的最大值为:{max(dct.values())}")
    maxval = max(dct.values())
    for key in dct:
        if dct[key] == maxval:
            print(f"字典中最大value对应的key为：{key}")

def averagevalue(dct):
    print(f"该字典中value的平均值为:{sum(dct.values())/len(dct)}")

maxvalue(dict1)
averagevalue(dict1)